<!DOCTYPE html>
<html lang=''>

<head>
  <meta charset='UTF-8'>
  <meta http-equiv='X-UA-Compatible' content='IE=edge'>
  <meta name='viewport' content='width=device-width, initial-scale=1.0'>
  <title>Document</title>
  <script src='./vue3.js'></script>
</head>

<body>
  <div id='app'>

    {{ msg }}

    <button @click="btnClick">按钮</button>
  </div>

</body>
<script>
  const app = Vue.createApp({
    data (props, context) {

      this.msg = '你好世界'
      return {}
    },
    methods: {
      btnClick () {
        console.log(this.msg);
        this.msg = '想做什么就去做，反正都会后悔'
        console.log(this.msg);
        // 强制重新渲染
        this.$forceUpdate()
      }
    },
  })
  app.mount('#app')
</script>

</html>
